 <{extends file="<{$tempdir}>/public/admin.html"}>
  <{block name=extendjs}>
   <script src="<{$siteurl}>/js/kindeditor/kindeditor.js" type="text/javascript" language="javascript"></script>
 <script src="<{$siteurl}>/templates/<{$tempdir}>/public/js/datepicker/WdatePicker.js" type="text/javascript" language="javascript"></script>
   <script type="text/javascript" language="javascript" src="<{$siteurl}>/templates/<{$tempdir}>/public/js/ajaxfileupload.js"> </script>

  <{/block}>
 <{block name=controlname}>编辑/添加通知<{/block}>
 <{block name=bodylist}>


       <div style="width:98%;overflow-y:auto;white-space:nowrap;height:660px;">

          <div class="tags">

          <div id="tagscontent">
            <form method="post" name="form1" action="<{ofunc type=url link="/adminpage/news/module/savenotice"}>"  >
              <div>
                <table border="0" cellspacing="2" cellpadding="4" class="list" name="table" id="table" width="100%">
                  <tbody>

                  	<tr onmouseover="this.bgColor='#F5F5F5';" onmouseout="this.bgColor='ffffff';" bgcolor="ffffff" id="selecttrstart">
                      <td class="left">通知标题</td>
                      <td><input type="text" name="title" id="title" value="<{$info['title']}>" class="skey" style="width:150px;" ></td>
                    </tr>
				  
				   <tr>
					 <td class="left">通知图片</td>
 					<td>
					<img src="<{$info['img']}>" width="136" height="130"  id="imgshow" <{if  empty($info['img'])}> style="display:none;"<{/if}> /> 
					<input type="hidden" name="img" id="img" value="<{$info['img']}>" class="skey" style="width:150px;" >  
					   <div id="div-headpicUpload" style="display:block;"> 
		                  <form id="form1" name="form1" method="post"  enctype="multipart/form-data" target="ifr-headpic-upload" onsubmit="return checkImagetype('1');">    
		                  	<div class=""> 
		               		<input name="head" type="file" id="imgFile" style="width:70px;float:left;margin-top:5px;" name="imgFile" onchange="$('#input1').val($(this).val())"  class="curbtn">
		               		<input id="submitImg" type="button" value="上传" class="ss_sc curbtn" style="width:40px;float:left; border:1px solid #ccc;background-color:white;height:22px;line-height:12px;margin-top:5px;margin-left:20px;" >   
		               	</div>  
		               </form> 
		             </div>
					  </td>
		 
				   
				   </tr>
				  
                    <tr onmouseover="this.bgColor='#F5F5F5';" onmouseout="this.bgColor='ffffff';" bgcolor="#ffffff" id="selecttrend">
                      <td class="left">通知时间</td>
                      <td>
                       <input class="Wdate datefmt" type="text" name="addtime" id="addtime" value="<{$info['addtime']|date_format:"%Y-%m-%d"}>"  onFocus="WdatePicker({isShowClear:false,readOnly:true});" />

                        </td>
                    </tr>
                    <tr onmouseover="this.bgColor='#F5F5F5';" onmouseout="this.bgColor='ffffff';" bgcolor="ffffff" id="selecttrstart">
                      <td class="left">排序</td>
                      <td><input type="text" name="orderid" id="orderid" value="<{$info['orderid']}>" class="skey" style="width:50px;" ></td>
                    </tr>

                   <tr onmouseover="this.bgColor='#F5F5F5';" onmouseout="this.bgColor='ffffff';" bgcolor="#ffffff">
                      <td class="left">通知详细内容</td>
                      <td>
                      <div class='nop'><script>KE.show({id:'content',allowFileManager : true,imageUploadJson:'<{ofunc type=url link="/other/saveupload"}>',fileManagerJson:'<{ofunc type=url link="/other/saveupload"}>',items:['source','|', 'justifyleft', 'justifycenter', 'justifyright','justifyfull', 'insertorderedlist', 'insertunorderedlist', '|', 'fontname', 'fontsize', '|', 'textcolor', 'bgcolor', 'bold','italic', 'underline', 'removeformat', '|', 'image', 'advtable', 'hr','link', 'unlink']});</script><textarea name="content" id="content" style='width:550px; height:260px;'><{$info['content']}></textarea></div>                      </td>

                    </tr>

                    <input type="hidden" name="uid" id="uid" value="<{$info['id']}>" class="skey" style="width:150px;">
                   </tbody>
                </table>
              </div>
              <div class="blank20"></div>
               <input type="submit" value="确认提交" class="button">
            </form>
          </div>
        </div>
        <div class="blank20"></div>

      </div>
      <div class="clear"></div>
    </div>
</div>
 <!--newmain 结束-->
<script>
$('#submitImg').click(function(){
		ajaxFileUpload();
	});
	function ajaxFileUpload()
	{
		$("#loading")
		.ajaxStart(function(){
			$(this).show();
		})
		.ajaxComplete(function(){
			$(this).hide();
		});
  
		$.ajaxFileUpload
		(
			{
				url:'<{ofunc type=url link="/adminpage/news/module/noticeupload/datatype/json"}>',
				secureuri:false,
				fileElementId:'imgFile',
				dataType: 'json',
				data:{name:'logan', id:'id'},
				success: function (data, status)
				{
					if(typeof(data.error) != 'undefined')
					{
						if(data.error == false)
						{ 
						 
							$('#img').val(data.msg);
 	           $('#imgshow').attr('src',data.msg);
 	           $('#img').val(data.msg);
 	                $('#imgshow').show(); 
						}else
						{
							alert(data.msg);
						}
					}else{
					  alert(data);
					}
				},
				error: function (data, status, e)
				{
					alert(e);
				}
			}
		)
		
		return false;

	}
</script>
<{/block}>